package naruto.datastructures.instruction;

import naruto.common.*;

/**
 *
 * @author nacuong
 */
public class IfInstruction extends IfCompleteInstruction<gov.nasa.jpf.jvm.bytecode.IfInstruction>{
  boolean conditionValue;
  
  public IfInstruction(gov.nasa.jpf.jvm.bytecode.IfInstruction ifInstruction){
    super(ifInstruction);
    conditionValue = !ifInstruction.getConditionValue();
  }

  public IfInstruction(gov.nasa.jpf.jvm.bytecode.IfInstruction ifInstruction, int recursiveCounter){
    super(ifInstruction, recursiveCounter);
    conditionValue = !ifInstruction.getConditionValue();
  } 
 
  public void setConditionValue(boolean conditionValue){
    this.conditionValue = conditionValue;
  }

  public boolean getConditionValue(){
    return this.conditionValue;
  }

  public boolean isLoopInstruction(){
    return InstructionCommon.isLoopInstruction((gov.nasa.jpf.jvm.bytecode.IfInstruction)instruction);
  }
}
